lib.use(['element', 'table', 'form','tablePlug'], function () {
    var table = layui.table;
    var form = layui.form;
    var logTable;

    //初始表格基础参数
    table.set(common.layui.table.config());
    // 渲染表格
        logTable = table.render({
            elem: '#logTable'
            , url: common.util.createUrl('/sys/log/list')
            , height: 'full-80'
            , cols: [[
                  {type:'checkbox'}
                , {field: 'id', title: 'Id', width: 80}
                , {field: 'username', title: '用户名', width: 80}
                , {field: 'operation', title: '用户操作', width: 80}
                , {field: 'method', title: '请求方法', minwidth: 80}
                , {field: 'params', title: '请求参数', minwidth: 80}
                , {field: 'time', title: '执行时长(毫秒)', width: 80}
                , {field: 'ip', title: 'IP地址', width: 100}
                , {field: 'createDate', title: '添加时间', width: 160}
            ]]

        });

    form.on('submit(searchFilter)', function(data){
        var param = data.field;
        searchTable(param)
        return false;
    });

    /**
     * 查询表格
     * @param params
     */
    function searchTable(params) {
        if(!params){
            params=common.from.serializeObject('#searchFrm');
        }
        logTable.reload({where: params})
    }
});
